package com.ytf.core.web.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ytf.core.web.mapper.RoleMapper;
import com.ytf.core.web.pojo.model.Role;
import com.ytf.core.web.service.IRoleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 角色表 服务实现类
 * </p>
 *
 * @author YTF
 * @since 2025-05-20
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {

    @Override
    public Boolean existsById(Long id) {
        return lambdaQuery().eq(Role::getId,id).exists();
    }

    @Override
    public Boolean existsByIds(List<Long> roleIds) {
        Long count = lambdaQuery().in(Role::getId, roleIds).count();
        return count == roleIds.size();
    }
}
